<template>
  <div>
    <DetailBanner :sightName='sightName' :bannerImg='bannerImg' :gallaryImgs='gallaryImgs'></DetailBanner>
    <DetailHeader></DetailHeader>
    <div class='con'>
      <DetailList :categoryList='categoryList'></DetailList>
    </div>
  </div>
</template>

<script>
import DetailBanner from './components/banner'
import DetailHeader from './components/header'
import DetailList from './components/list'
import axios from 'axios'
export default {
        name: 'Detail',
        components: { DetailBanner,
                      DetailHeader,
                      DetailList
                      },
        data:function(){
          return {
               categoryList:[],
               sightName:'',
               bannerImg:'',
               gallaryImgs:[]
          }
        },
        methods: {
            getDetailInfo () {
              axios.get('/api/detail.json')
              .then(this.getDetailInfoSucc)
            },
            getDetailInfoSucc (res) {
              res=res.data
                if(res.ret && res.data){
                const data = res.data
                this.categoryList=data.categoryList
                this.sightName=data.sightName
                this.bannerImg=data.bannerImg
                this.gallaryImgs=data.gallaryImgs
                
                }
              },
            },
            mounted () {
            this.getDetailInfo()
            }
    }
</script>

<style lang='stylus' scoped>
.con
  height:50rem
</style>
